<template>
  <div class="global">
    <div class="head">
      <div>
        <img src="../../assets/xh.png" style="width: 100px;height: 60px;vertical-align: middle;" alt="" srcset="">
        <div class="title" style="color: #fff;display: inline-block;">重庆理工大学</div>
      </div>
      <div class="">
        <el-menu :default-active="$route.path" router class="el-menu-demo menu1" mode="horizontal">
          <el-menu-item index="userhome">首页</el-menu-item>
    
          <el-submenu index="2">
            <template slot="title">我的成果</template>
            <el-menu-item index="/teacher/lw">论文</el-menu-item>
            <el-menu-item index="/teacher/jxjl">教学奖励</el-menu-item>
            <el-menu-item index="/teacher/kcjx">课程教学</el-menu-item>
            <el-menu-item index="/teacher/kyxm">科研项目</el-menu-item>
            <el-menu-item index="/teacher/zl">专利</el-menu-item>
          </el-submenu>

          <el-menu-item index="/teacher/Personal">个人中心</el-menu-item>
          <el-menu-item index="/teacher/Personal1">教师主页</el-menu-item>

        </el-menu>
      </div>

      <div class="">

        <!-- <img v-if="user.icon == null" src="../../assets/logo.png"
                  style="margin-right: 10px; width: 50px;height: 50px;border-radius: 50%;vertical-align: middle;"
                  alt="" srcset="">
              <img v-else :src="user.icon"
                  style="margin-right: 10px; width: 50px;height: 50px;border-radius: 50%;vertical-align: middle;"
                  alt="" srcset=""> -->

        <el-dropdown>
          <span class="el-dropdown-link" style="color: #fff;">
            {{ user.username }}<i class="el-icon-arrow-down el-icon--right"></i>
          </span>
          <el-dropdown-menu slot="dropdown">
            <el-dropdown-item @click.native="fabu">通知与消息</el-dropdown-item>
            <el-dropdown-item @click.native="logout">退出登录</el-dropdown-item>
          </el-dropdown-menu>
        </el-dropdown>

      </div>
    </div>
    <div class="lbt" v-if="$route.path == '/teacher/userhome'">
      <el-carousel style="height:300px">
        <el-carousel-item>
          <img src="../../assets/lb1.jpg" style="width: 100% ;" alt="">
        </el-carousel-item>
        <el-carousel-item>
          <img src="../../assets/lb2.jpg" style="width: 100% ;" alt="">
        </el-carousel-item>
        <el-carousel-item>
          <img src="../../assets/lb3.jpg" style="width: 100% ;" alt="">
        </el-carousel-item>
      </el-carousel>
    </div>
    <router-view></router-view>
    <div class="bottomm">
      <div>Copyright © 2010 成果管理系统 京公网安备 11010802045678 互联网ICP备案：京ICP备06029423号-1</div>
      <div>地址: 北京市海淀区西土城路10号 邮编: 100876 技术支持: 010-62283919</div>
      <div>站长统计 | 今日IP[1956] | 今日PV[57416] | 昨日IP[3026] | 昨日PV[89630] | 当前在线[671]</div>
    </div>
  </div>
</template>

<style>
.bottomm div {
  color: #fff;
  font-size: 14px;
  text-align: center;
  margin-bottom: 10px;
}

.bottomm {
  width: 100%;
  height: auto;
  padding: 10px;
  box-sizing: border-box;
  background: #64c5b1;
  position: fixed;
  bottom: 0px;
}
</style>
<script>
import service from '@/utils/request';
export default {
  data() {
    return {
      user: {}
    }
  },
  mounted() {
    this.getinfo()
  },
  methods: {
    async getinfo() {
      const res = await service.get("/auth/info");
      console.log(res)
      this.user = res.data.userInfo
      window.localStorage.setItem("userinfo", JSON.stringify(this.user))
    },
    personal() {

      this.$router.push({
        path: "/userinfo"
      })

    },
    fabu() {

      this.$router.push({
        path: "/teacher/notice"
      })

    },


    logout() {
      window.localStorage.clear()
      this.$router.push({
        path: "/"
      })
    }
  }
}
</script>
<style>
.el-menu--horizontal>.el-menu-item:not(.is-disabled):focus,
.el-menu--horizontal>.el-menu-item:not(.is-disabled):hover,
.el-menu--horizontal>.el-submenu .el-submenu__title:hover {
  background: #2bb7e5 !important;

}

.el-carousel__container {
  height: 100%;
}
.el-submenu__title{
  color: #fff !important;
}

/* .el-menu{
  background: transparent !important;
  color: #fff !important;
} */
</style>
<style scoped>
.head {
  width: 100%;
  height: 60px;
  padding: 0px 10px;
  box-sizing: border-box;
  background: #64c5b1;
  /* background: #2c334c; */
  display: flex;
  align-items: center;
  justify-content: space-around;

}

.head .el-menu {
  background: transparent !important;
  color: #fff !important;
}

.head .el-menu-item {
  color: #fff !important;
}

.menu1 .is-active {
  background: #2bb7e5 !important;
}

.menu1 .el-submenu__title:hover {
  background: #2bb7e5 !important;
}

.menu1 .el-menu-item:hover {
  background: #2bb7e5 !important;
}

.global {
  width: 100%;
  height: 100%;
  padding-bottom: 120px;
  box-sizing: border-box;
  background: #f7f7f7;
  overflow: auto;

}
</style>